package com.ztesoft.web.common.customdb.dao;

import java.util.List;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import com.ztesoft.web.common.customdb.dao.mapper.IDbLinkInstanceCustomMapper;
import com.ztesoft.web.common.vo.DbLinkInstanceVO;

@Repository
public class DbLinkInstanceCustomDao extends SqlSessionDaoSupport {

    @Resource(name = "majorSqlSessionTemplate")
    public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
        super.setSqlSessionTemplate(sqlSessionTemplate);
    }

    public int insertBatch(List<DbLinkInstanceVO> records) {
    	return getMapper().insertBatch(records);
    }

    public int deleteByDbBaseId(Integer dbBaseId) {
    	return getMapper().deleteByDbBaseId(dbBaseId);
    }

    public IDbLinkInstanceCustomMapper getMapper() {
    	return getSqlSession().getMapper(IDbLinkInstanceCustomMapper.class);
    }

}
